
    <div class="layui-row" list_url="">
    <span class="fl">
        <a class="layui-btn btn-default" onclick="window.location.href=window.location.href;"><i class="layui-icon">ဂ</i></a>
    </span>
    <span class="fr">
		日期范围：
        <div class="layui-input-inline">
		<input type="text" id="min_time" name="min_time" placeholder="最小时间" class="layui-input">
        </div>
		-
        <div class="layui-input-inline">
		<input type="text" id="max_time" name="max_time" placeholder="最大时间" class="layui-input">
        </div>
        <div class="layui-input-inline">
		<select onchange="com_quicktime(this)" style="width:90px">
			<option value="0">快捷时间</option>
			<option value="1">最近1天</option>
			<option value="2">最近2天</option>
			<option value="3">最近3天</option>
			<option value="4">最近4天</option>
			<option value="5">最近5天</option>
			<option value="6">最近6天</option>
			<option value="7">最近7天</option>
			<option value="8">最近8天</option>
			<option value="9">最近9天</option>
			<option value="10">最近10天</option>
			<option value="20">最近20天</option>
			<option value="30">最近30天</option>
			<option value="60">最近60天</option>
			<option value="90">最近90天</option>
			<option value="365">最近365天</option>
		</select>
        </div>
        <div class="layui-input-inline" style="width:300px;">
            <input type="text" name="keyword" autocomplete="off" placeholder="搜索任务标题" class="layui-input">
        </div>
        <select name="app_id" class="form-control" style="width:80px; display: inline">
            <option value="100all">全部项目</option>
            <{volist name='app' id='v'}>
            <option value="<{$key}>" <{if $key==$w['app_id']}>selected<{/if}>><{$v}></option>
            <{/volist}>
        </select>
        <select name="user_id" class="form-control" style="width:80px; display: inline">
            <option value="100all">全部执行人</option>
            <{volist name='user' id='v'}>
            <option value="<{$key}>" <{if $key==$w['user_id']}>selected<{/if}>><{$v}></option>
            <{/volist}>
        </select>
        <select name="status" class="form-control" style="width:80px; display: inline">
            <option value="100all">全部状态</option>
            <{volist name='status' id='v'}>
            <option value="<{$key}>" <{if $key==$w['status']}>selected<{/if}>><{$v}></option>
            <{/volist}>
        </select>
        <button class="layui-btn mgl-20" search_id="list">查询</button>
    </span>
</div>
<div>
    <blockquote class="layui-elem-quote layui-quote-nm">
    <p>项目：
      <{volist name='app' id='v'}>
      <button class="layui-btn <{if $w['app_id']!=$key}>layui-btn-primary<{/if}> layui-btn-small" tname="app_id" tval="<{$key}>"><{$v}></button>
      <{/volist}>
    </p>
    <p>执行：
      <{volist name='user' id='v'}>
      <button class="layui-btn <{if $w['user_id']!=$key}>layui-btn-primary<{/if}> layui-btn-small" tname="user_id" tval="<{$key}>"><{$v}></button>
      <{/volist}>
    </p>
    <p>状态：
      <{volist name='status' id='v'}>
      <button class="layui-btn <{if $w['status']!=$key}>layui-btn-primary<{/if}> layui-btn-small" tname="status" tval="<{$key}>"><{$v}></button>
      <{/volist}>
    </p>
    </blockquote>
  <table class="layui-table">
    <thead>
      <tr>
        <th>项目名称</th>
        <th>任务标题</th>
        <th>指派人</th>
        <th>执行人</th>
        <th>预计完成</th>
        <th>优先级</th>
        <th>最后更新</th>
        <th>最后反馈</th>
        <th>状态</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody list_body>
    </tbody>
  </table>
  <div list_page>
  </div>
  <p list_count>
  </p>
</div>
<script>
$(document).ready(function(){
    $("[search_id='list']").click();
    $("[tval]").click(function(){
        var obj = GetRequest();
        obj['url']="http://"+window.location.host+window.location.pathname;
        obj[$(this).attr('tname')] = $(this).attr('tval');
        window.location.href = createUrl(obj);
    });
});
// 获取url中的参数，并返回一个对象
function GetRequest() {
    var url = location.search; //获取url中"?"符后的字串
    var theRequest = {};
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        strs = str.split("&");
        for (var i = 0; i < strs.length; i++) {
            theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
        }
    }
    return theRequest;
};
// 生成一个带参数的url
function createUrl(obj) {
    var length = obj && obj.length,
        idx = 0,
        url = obj.url + '?';
    for (var key in obj) {
        if (key != 'url' && obj[key] !== null) {
            url += (key + '=' + encodeURIComponent(obj[key]) + '&');
        }
    }
    return url.substring(0, url.lastIndexOf('&'));
}

</script>
